package com.report.controller;

import com.report.dto.Response;
import com.report.entity.TableRowMapping;
import com.report.service.TableRowMappingService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * 字段映射配置
 */
@RestController
@RequestMapping("/api/tableRowMapping")
public class TableRowMappingController {

    @Resource
    private TableRowMappingService tableRowMappingService;

    /**
     * 配置记录
     *
     * @param request
     * @return
     */
    @PostMapping("/record")
    public Response records(@RequestBody TableRowMapping request) {
        return tableRowMappingService.records(request);
    }


    /**
     * 添加配置
     *
     * @param request
     * @return
     */
    @PostMapping("/insert")
    public Response insert(@RequestBody TableRowMapping request) {
        return tableRowMappingService.insert(request);
    }


    /**
     * 删除配置
     *
     * @param request
     * @return
     */
    @PostMapping("/delete")
    public Response delete(@RequestBody TableRowMapping request) {
    	return tableRowMappingService.delete(request);
    }

}
